﻿<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>@ViewData["Title"] - 问卷系统</title>
    <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" />
    <link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
    <link rel="stylesheet" href="~/css/custom.css" asp-append-version="true" />
    @if (ViewContext.RouteData.Values["controller"]?.ToString() == "Home" && ViewContext.RouteData.Values["action"]?.ToString() == "Index")
    {
        <link rel="stylesheet" href="~/css/home.css" asp-append-version="true" />
    }
    <style>
        .navbar {
            background: linear-gradient(135deg, #1a237e 0%, #0d47a1 100%) !important;
            padding: 1rem 0;
            transition: all 0.3s ease;
        }
        
        .navbar-brand {
            font-size: 1.5rem;
            transition: transform 0.3s ease;
        }
        
        .navbar-brand:hover {
            transform: scale(1.05);
        }
        
        .nav-link {
            position: relative;
            padding: 0.5rem 1rem;
            margin: 0 0.2rem;
            transition: all 0.3s ease;
        }
        
        .nav-link::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            width: 0;
            height: 2px;
            background: #fff;
            transition: all 0.3s ease;
            transform: translateX(-50%);
        }
        
        .nav-link:hover::after,
        .nav-link.active::after {
            width: 80%;
        }
        
        .btn-light {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: #fff;
            transition: all 0.3s ease;
        }
        
        .btn-light:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: translateY(-2px);
        }
        
        .btn-outline-light {
            color: #fff;
            border-color: #fff;
            transition: all 0.3s ease;
        }
        
        .btn-outline-light:hover {
            background-color: #fff;
            color: #1a237e;
            transform: translateY(-2px);
        }
        
        .btn-light-outline {
            background: transparent;
            border: 1px solid #fff;
            color: #fff;
            transition: all 0.3s ease;
        }
        
        .btn-light-outline:hover {
            background: rgba(255, 255, 255, 0.1);
            transform: translateY(-2px);
        }
        
        .footer {
            background: linear-gradient(135deg, #1a237e 0%, #0d47a1 100%);
            padding: 4rem 0 2rem;
            position: relative;
            overflow: hidden;
        }
        
        .footer::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, #4caf50, #2196f3, #9c27b0);
        }
        
        .footer h5 {
            font-weight: 600;
            margin-bottom: 1.5rem;
            position: relative;
            display: inline-block;
        }
        
        .footer h5::after {
            content: '';
            position: absolute;
            bottom: -8px;
            left: 0;
            width: 40px;
            height: 2px;
            background: #4caf50;
        }
        
        .footer .text-light-50 {
            color: rgba(255, 255, 255, 0.7) !important;
            transition: all 0.3s ease;
        }
        
        .footer a {
            transition: all 0.3s ease;
        }
        
        .footer a:hover {
            color: #fff !important;
            transform: translateX(5px);
            text-decoration: none;
        }
        
        .footer .social-icons a {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.1);
            transition: all 0.3s ease;
        }
        
        .footer .social-icons a:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: translateY(-3px);
        }
        
        .dropdown-menu {
            border: none;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            border-radius: 8px;
        }
        
        .dropdown-item {
            padding: 0.7rem 1.5rem;
            transition: all 0.3s ease;
        }
        
        .dropdown-item:hover {
            background: rgba(26, 35, 126, 0.1);
            transform: translateX(5px);
        }
    </style>
    @await RenderSectionAsync("Styles", required: false)
</head>
<body class="d-flex flex-column min-vh-100">
    <header>
        <nav class="navbar navbar-expand-lg navbar-dark shadow-sm">
            <div class="container">
                <a class="navbar-brand d-flex align-items-center" asp-controller="Home" asp-action="Index">
                    <i class="fas fa-vote-yea me-2"></i>
                    <span class="fw-bold">问卷系统</span>
                </a>
                <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                    <span class="navbar-toggler-icon"></span>
                </button>
                <div class="collapse navbar-collapse" id="navbarNav">
                    <ul class="navbar-nav me-auto">
                        <li class="nav-item">
                            <a class="nav-link @(ViewContext.RouteData.Values["controller"]?.ToString() == "Vote" && ViewContext.RouteData.Values["action"]?.ToString() == "Index" ? "active" : "")" 
                               asp-controller="Vote" asp-action="Index">
                                <i class="fas fa-list-ul me-1"></i>投票列表
                            </a>
                        </li>
                        @if (User.Identity?.IsAuthenticated == true)
                        {
                            <li class="nav-item">
                                <a class="nav-link @(ViewContext.RouteData.Values["controller"]?.ToString() == "Vote" && ViewContext.RouteData.Values["action"]?.ToString() == "MyVotes" ? "active" : "")" 
                                   asp-controller="Vote" asp-action="MyVotes">
                                    <i class="fas fa-user-edit me-1"></i>我的投票
                                </a>
                            </li>
                        }
                        <li class="nav-item">
                            <a class="nav-link @(ViewContext.RouteData.Values["controller"]?.ToString() == "Surveys" && ViewContext.RouteData.Values["action"]?.ToString() == "Index" ? "active" : "")" 
                               asp-controller="Surveys" asp-action="Index">
                                <i class="fas fa-clipboard-list me-1"></i>问卷列表
                            </a>
                        </li>
                        @if (User.Identity?.IsAuthenticated == true)
                        {
                            <li class="nav-item">
                                <a class="nav-link @(ViewContext.RouteData.Values["controller"]?.ToString() == "Surveys" && ViewContext.RouteData.Values["action"]?.ToString() == "MySurveys" ? "active" : "")" 
                                   asp-controller="Surveys" asp-action="MySurveys">
                                    <i class="fas fa-user me-1"></i>我的问卷
                                </a>
                            </li>
                        }
                    </ul>
                    <div class="d-flex align-items-center">
                        <div class="dropdown me-3">
                            <button class="btn btn-light dropdown-toggle" type="button" id="createDropdown" data-bs-toggle="dropdown" aria-expanded="false">
                                <i class="fas fa-plus-circle me-1"></i>创建
                            </button>
                            <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="createDropdown">
                                <li>
                                    <a class="dropdown-item @(ViewContext.RouteData.Values["controller"]?.ToString() == "Vote" && ViewContext.RouteData.Values["action"]?.ToString() == "Create" ? "active" : "")" 
                                       asp-controller="Vote" asp-action="Create">
                                        <i class="fas fa-vote-yea me-2"></i>创建投票
                                    </a>
                                </li>
                                <li>
                                    <a class="dropdown-item @(ViewContext.RouteData.Values["controller"]?.ToString() == "Surveys" && ViewContext.RouteData.Values["action"]?.ToString() == "Create" ? "active" : "")" 
                                       asp-controller="Surveys" asp-action="Create">
                                        <i class="fas fa-clipboard me-2"></i>创建问卷
                                    </a>
                                </li>
                            </ul>
                        </div>
                        <partial name="_LoginPartial" />
                    </div>
                </div>
            </div>
        </nav>
    </header>

    <main class="flex-grow-1 py-4">
        <div class="container">
            @RenderBody()
        </div>
    </main>

    <footer class="footer mt-auto">
        <div class="container">
            <div class="row">
                <div class="col-md-4">
                    <h5 class="text-light mb-3">关于我们</h5>
                    <p class="text-light-50">该系统是一个便捷的在线问卷平台，帮助师生轻松创建和管理各类问卷、投票活动。</p>
                </div>
                <div class="col-md-4">
                    <h5 class="text-light mb-3">快速链接</h5>
                    <ul class="list-unstyled">
                        <li class="mb-2"><a href="#" class="text-light-50 text-decoration-none"><i class="fas fa-book me-2"></i>使用指南</a></li>
                        <li class="mb-2"><a href="#" class="text-light-50 text-decoration-none"><i class="fas fa-question-circle me-2"></i>常见问题</a></li>
                        <li class="mb-2"><a href="#" class="text-light-50 text-decoration-none"><i class="fas fa-envelope me-2"></i>联系我们</a></li>
                    </ul>
                </div>
                <div class="col-md-4">
                    <h5 class="text-light mb-3">关注我们</h5>
                    <div class="social-icons d-flex gap-3">
                        <a href="#" class="text-light-50"><i class="fab fa-weixin"></i></a>
                        <a href="#" class="text-light-50"><i class="fab fa-qq"></i></a>
                        <a href="#" class="text-light-50"><i class="fab fa-weibo"></i></a>
                    </div>
                </div>
            </div>
            <hr class="my-4 border-light opacity-25">
            <div class="text-center text-light-50">
                <small>&copy; 2025 问卷系统 - 让问卷更简单</small>
            </div>
        </div>
    </footer>

    <script src="~/lib/jquery/dist/jquery.min.js"></script>
    <script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
    <script src="~/js/site.js" asp-append-version="true"></script>
    @await RenderSectionAsync("Scripts", required: false)
</body>
</html>

